package main

import (
	"fmt"
	"sync"
	"time"
)



func main() {
	const COUNT = 100000
	num := 1
	sum := 0
	m := &sync.Mutex{}
	for i := 0; i < 10; i++ {
		go func() {
			m.Lock()
			if num<=COUNT {
				sum+=num
				num++
			}
			m.Unlock()
		}()
	}
	time.Sleep(100)
	fmt.Println(num)

}